package controller.commands;

import core.ConnectException;
import core.TriggerPort;
import javax.swing.JOptionPane;
import view.GUI.LabelReader;

/**
 *
 * @author Arfeniel, modified by Ben
 */
public class ExecuteThread extends Thread {

    TriggerPort tp = null;

    public ExecuteThread(TriggerPort triggerPort) {
        this.tp = triggerPort;
    }

    @Override
    public void run() {
        try {
           tp.call();
        } catch (ConnectException ex) {
            JOptionPane.showMessageDialog(null, "ExecuteThread: " + ex.getMessage(), LabelReader.getInstance().getString("Error"), JOptionPane.ERROR_MESSAGE);
        }
    }
}
